home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Camelot / Camelot 064 (1990-02)(Swedish User Group of Amiga)(SE)(PD)[WB].zip / Camelot 064 (1990-02)(Swedish User Group of Amiga)(SE)(PD)[WB].adf / PLT / PLT.doc < prev    next >
Text File  |  1990-02-14  |  15KB  |  356 lines

  1.                                 PLT:
  2.                             Version 1.3a
  3.                           December 9, 1989
  4.  
  5.                            Rich Champeaux
  6.                              Jim Miller
  7.  
  8.  
  9. NOTICE:  PLT: is not in the public domain.  We reserve all rights to both the
  10.          executable and the source.  PLT: may not be sold without expressed,
  11.          written permission of either Rich Champeaux or Jim Miller.  PLT: is
  12.          however, freely distributable provided that this file accompanies it.
  13.  
  14.  
  15. PLT: is a file-handler that emulates a plotter by accepting HP-GL commands, 
  16. creating a raster image, and then dumping it to any Preferences supported 
  17. graphics printer.  The current resolution set with preferences is used, 
  18. allowing PLT: to make full use of a printer's capability.  
  19.  
  20. PLT: accepts virtually all of the standard HP-GL commands, including scaling
  21. and text.  The commands that were not implemented are those which are
  22. generally contained in an extended graphics cartridge, such as: circles, 
  23. arcs, filled regions, etc.
  24.  
  25.  
  26. PLT: Features:
  27.  
  28.    - Lines are stored in a tree/linked list structure untill the handler is
  29.      closed or the command AF or PG is recieved.  The plot is then rasterized
  30.      and dumped to the printer in strips.  This allows plots to be printed
  31.      with resolutions and page sizes for which a raster for the entire page
  32.      would not fit in memory.
  33.      
  34.    - Pens can be assigned colors and thicknesses.  The pen colors are defined
  35.      by RGB values, and thicknesses are defined in pixel widths.  The pens
  36.      can be defined in an environment variable or when the handler is opened.
  37.      The number of bit planes used for the raster depends on the number of
  38.      different colors requested, not the number of pens.  Therefore, 7 black
  39.      pens and 5 red pens of various thicknesses, would only take 2 bit planes.
  40.    
  41.    - PLT: supports variable paper sizes.  It knows the standard paper sizes,
  42.      A, B, C, D, and E, and can also use the paper size defined by the limits 
  43.      fields of Preference's Graphic 2 screen.  The entire width of any dot
  44.      matrix printer supported by Preferences can be used, including wide 
  45.      carriage printers.  If the requested page size is too large to be 
  46.      printed, a requester is displayed, giving the option to reduce the size
  47.      of the plot (keeping the aspect ratio) to the maximum size of the 
  48.      printer.  The plot can also be reduced to the page size specified by 
  49.      Preferences.
  50.      
  51.    - PLT: has a preview mode that displays the plot on the screen.  The 
  52.      aspect ratio of the requested page is preserved.  This allows the plot 
  53.      to be displayed on the screen the way it will appear on paper.  
  54.      A 640 x 400 screen is used to provide maximum resolution.
  55.      
  56.    - PLT: v1.3 supports multiple, disk-resident fonts.  The fonts can be 
  57.      changed or created by the user.  An included program, 'cf', is used to
  58.      convert the fonts from a text representation of the vectors to a
  59.      format usable by PLT:.  Fonts are loaded in only when needed, and 
  60.      fonts can be changed durring a plot with the CS, CA, SS, and SA HP-GL
  61.      commands.  A standard ascii font and a math-greek font are included
  62.      with this release.
  63.    
  64.    - PLT: can also be used by programs that assume that a plotter is 
  65.      connected to the serial port by using the CMD command.  For example:
  66.         CMD serial.device PLT:
  67.    
  68.    - PLT: has two memory usage modes that it can run in: memory-squander and
  69.      memory-conserve.  The memory-squander mode sits a tree structure on top
  70.      of the linked list to speed up inserts.  The memory-conserve mode uses
  71.      only a linked list.  The memory-squander mode is much faster than the
  72.      memory-conserve mode since it's insert time is O(log2(n)), but it 
  73.      requires twice as much memory per line.  The memory-conserve mode's 
  74.      insert time is O(n), and becomes unbearably slow as the number of lines
  75.      becomes greater than about 8000.  The memory-conserve mode does, however,
  76.      allow twice as many lines to be plotted.  PLT: v1.3 defaults to the 
  77.      memory-squander mode and will automatically remove the tree and switch to
  78.      the memory-conserve mode when availble memory is less than 2k.
  79.  
  80. -----------------------------------------------------------------------------
  81.  
  82. Installing PLT:
  83.  
  84.    1) Copy the file 'plt-handler' to the L: directory.
  85.    2) Create a directory and assign "PLTDATA:" to it.
  86.    3) copy the files 'ascii', 'math-greek', and 'pltfontnames' to the
  87.       directory 'PLTDATA:'
  88.    4) Add the following to the mountlist:
  89.    
  90.       PLT:        Handler   = L:plt-handler
  91.                   StartUp   = P/000-1
  92.                   StackSize = 5000
  93.                   Priority  = 5
  94.                   GlobVec   = 1
  95.       #
  96.       
  97.       
  98.       (Note: the StartUp field is used to pass default parameters to the
  99.        handler.  It is explained below.)
  100.        
  101.    5) Mount the handler using the command 'mount PLT:'
  102.    
  103. -----------------------------------------------------------------------------
  104.  
  105. Switches and Pen Definitions:
  106.  
  107.    PLT:'s mode switches and pen definitions are recieved from three sources:
  108. the mountlist entry, an environment variable, and the file name path.  All
  109. three sources use the following format:
  110.  
  111.       SWITCHES/RGB-t/RGB-t/RGB-t...
  112.  
  113.       where:
  114.          SWITCHES could be:  A..E  Selects standard page sizes A,B,C,D, or E.
  115.                                    (default is A)
  116.          
  117.                                 P  Selects the page size specified by the 
  118.                                    limits fields of Preferences' Graphics 2
  119.                                    screen.
  120.                                    
  121.                                 R  Reduces the plot (keeping the aspect ratio)
  122.                                    to the size specified by the limits fields
  123.                                    of Preferences' Graphics 2 screen.
  124.                                    
  125.                                 S  Draws plot on preview screen.
  126.                                 
  127.                                 W  Displays a status window when plotting to
  128.                                    printer. (default)
  129.                                    
  130.                                 M  Forces PLT: to use the memory-conserve
  131.                                    mode.
  132.                                  
  133.                                 L  Makes the label command do a carriage
  134.                                    return when it receives a line feed.
  135.                                    This switch allows copatability with the
  136.                                    Amiga since the newline character on the 
  137.                                    amiga is a linefeed.
  138.                                    
  139.                      (A '-' can be prefixed to the switches R, S, W, M, and L
  140.                       to negate them.  The switches A, B, C, D, E, and P are
  141.                       mutually exclusive, therefore one negates another)
  142.          
  143.          Pens are described as: RGB-t
  144.             where:
  145.                                 RGB is the color of the pen in hex.
  146.                                 t   is the pen thickness in pixels. (optional,
  147.                                     defaults to 1).
  148.                                     
  149.       Ex.
  150.          SB/000-1/f00-3/0c3-2
  151.          -WP/0f0/000-2/f30
  152.          /000-1/0f0-1/f00-2
  153.          DRM
  154.          C-R/000-1
  155.          
  156.    The switches and pen definitions defined in the mountlist or the 
  157. environment variable "pltinfo" are used as the defaults for PLT:.  If the
  158. environment variable exists, the entry in the mountlist is ignored.  These
  159. defaults can be temparily overridden by the switches and pen definitions
  160. passed to PLT: as the file path (Ex. PLT:SB/000-1/f00-2).  The switches
  161. specified with the file path selectively override the defaults.  For
  162. example, if the defaults were 'SBWR' and the switches specified in the file
  163. path were '-S-R' then the S and R switches would be negated, but the other
  164. switches would be unaffected.  Defining pens in the file path, however,
  165. completly replaces the default pen definitions.  A maximum of 15 pens can
  166. be defined.  If a pen is selected whose number is greater than the total
  167. number of defined pens, then the pen number is MODed with the total number
  168. of defined pens.
  169.  
  170.    To define the switches and pen definitions in the mountlist, use the field
  171. 'StartUp'.
  172.  
  173.    Ex.      StartUp = P/000-1/f00-1/0f0-1/00f-1
  174.    
  175. The StartUp field appears to be limited to 39 characters and cannot start 
  176. with a '-'.  If you require more characters or a leading '-', use the 
  177. environment variable.
  178.  
  179.    The enviroment variable used is "pltinfo".  It is set in the following
  180. manner:
  181.  
  182.    setenv pltinfo P/000-1/f00-1/0f0-1/00f-1
  183.    
  184. The enviroment variable has the advantage of being easily changed after PLT:
  185. has been mounted.
  186.  
  187. -----------------------------------------------------------------------------
  188.  
  189. Fonts:
  190.  
  191.    The fonts of PLT: are disk resident and user modifiable.  The fonts are
  192. stored in the directory PLTDATA:.  A file in that directory, 'pltfontnames',
  193. contains the names of the fonts accessible to PLT:.  The file contains a list
  194. of font names, one name per line, that are to be associated with the font
  195. numbers 0 thru 50.  The fonts are selected using the HP-GL character set
  196. commands: CS, CA, SS, SA.  CS and CA designate the standard and alternate
  197. fonts, respectively.  SS is then used to make the standard font the current
  198. font, and SA is used to make the alternate font the standard font.  The 
  199. default font is font 0, which is the first font listed in the file 
  200. 'pltfontnames'.
  201.  
  202.    The fonts are described by a text file, whose name ends with the extension
  203. '.fnt', and then must be compiled with the program 'cf' before they can be 
  204. used by PLT:.  The characters consist of 1 or more strokes of the pen.  Each 
  205. character in the font has an entry which specifies the value of the character 
  206. and a list of end points describing each stroke of the pen.
  207.  
  208.    The first 2 numbers in the file contain the width and height of the
  209. character cell.  Large characters, such as capital letters should completely
  210. fill the cell, however, the characters are allowed to have end points that
  211. lie outside of the cell.
  212.  
  213.    The first line of each character entry consists of an '*' followed by the
  214. value of the character.  The remaining part of the line is a comment.  
  215. Following that are the pen strokes that make up the character.  Each stroke
  216. consists of a number indicating the number of end points in the stroke,
  217. followed by the the starting location of the stroke, followed by the end
  218. points of the lines in the stroke.  Below is an example of a character entry.
  219. The comments on the right are only for the documentation and should not be
  220. in the actual font file.
  221.  
  222.  
  223. *  48 '0'      Below are comments that should not be in the actual file
  224. 8              <- number of end points (lines) in the first stroke.
  225. 12 3           <- starting point of the first stroke
  226. 12 18          <- end point of the first line in the stroke
  227. 9 21           <-|
  228. 3 21           <-|
  229. 0 18           <-|
  230. 0 3            <-|- more end points
  231. 3 0            <-|
  232. 9 0            <-|
  233. 12 3           <-|
  234. 1              <- number of end points (lines) in the next stroke
  235. 10 20          <- starting point of next stroke
  236. 2 1            <- end point of the only line in the second stroke
  237.  
  238.    The character entry is ended by the occurance of the '*' marking the next
  239. character entry.
  240.  
  241.    The font file is compiled and placed in the PLTDATA: directory by the 
  242. program 'cf'.
  243.  
  244.    Ex.   cf ascii
  245.  
  246. The font file is assumed to end with the extension '.fnt'.
  247.  
  248.    The cf program is only a simple state machine, so it does not handle errors
  249. very well.  It merely tells you what the character it discovered the error at
  250. was and the position of that character in the file.  Source to the cf program
  251. is included with this release.
  252.  
  253. -----------------------------------------------------------------------------
  254.  
  255. Specifing the Raster Height:
  256.  
  257.    The maximum height of the raster that PLT: uses when it prints a strip of
  258. the plot can be specified by the user.  The user specifies the maximum number
  259. of lines in the raster using the enviroment variable 'PltMaxRasHgt'.
  260.  
  261.    Ex.   setenv PltMaxRasHgt 100
  262.    
  263.    Specifing the maximum raster height is a way of controlling the amount of
  264. memory that PLT: uses for the raster.  The actual raster height that is used
  265. is always a multiple of the number of lines that the printer driver can print
  266. in one "strip" at the specified resolution.  The minimum raster height, and 
  267. the default, is the height of one "strip".
  268.  
  269. -----------------------------------------------------------------------------
  270.  
  271. Specifing the Left Margin:
  272.  
  273.    The left margin of the plot can be specified in inches using the environment
  274. variable 'PltXOffset'.  
  275.  
  276.    Ex.   setenv PltXOffset 0.5
  277.    
  278.    The value is only accurate to one tenth of an inch.
  279.  
  280. -----------------------------------------------------------------------------
  281.  
  282. Operation:
  283.  
  284. PLT: can be used in a variety of manners. 
  285.  
  286. 1.      You can copy files containing HP-GL commands to the handler.
  287.             Ex.  copy <filename> PLT:
  288.         
  289. 2.      You can direct a CAD package to plot to a file and give the 
  290.         filaname as "PLT:"
  291.         
  292. 3.      You can redirect output from a CAD package heading towards
  293.         the serial port to the handler.
  294.             Ex.  cmd serial.device PLT:
  295.         
  296. 4.      You can write your own applications that write directly to the
  297.         handler PLT:.
  298.             Ex.   file=fopen("PLT:","w");
  299.  
  300. -----------------------------------------------------------------------------
  301.  
  302. Memory:
  303.  
  304. PLT: does take up quite a bit of memory.  Not as much as a full raster image,
  305. but still quite alot.
  306.  
  307. PLT: code needs      35K
  308. printer.device needs 49K
  309. raster varies from    5K - 14K
  310. each lines takes     28 bytes  (or 16 in the Memory Conserve mode)
  311.  
  312.  
  313. Before data is read, PLT: removes about 90K - 100K from your system.
  314.  
  315. An average plot will usually require an additional 30-50k.
  316. A complex plot will usually require about 180K or more.
  317.  
  318. -----------------------------------------------------------------------------
  319.  
  320.  
  321. QUESTIONS or BUG REPORTS
  322.  
  323.    Since there have been so many changes to PLT: from v1.2, there are sure to
  324. be numerous bugs lurking in the code.  Any questions or bug reports should be
  325. sent to the following addresses:
  326.  
  327. Rich Champeaux
  328. rchampe@hubcap.clemson.edu
  329.  
  330. or
  331.  
  332. Jim Miller
  333. jvmiller@rdrc.rpi.edu
  334.  
  335. or send US mail to: 
  336.  
  337. Rich Champeaux
  338. 11 Mansfield Dr.
  339. Chelmsford, MA  01824
  340.  
  341. (Sending US mail to the above address will be slow, since that is my home
  342.  address, not my school address)
  343.  
  344.    Every attempt will be made to solve your problems within a reasonable 
  345. amount of time.
  346.  
  347.  
  348. | It would be appreciated if anyone using PLT: would email or US mail your
  349. | comments to one of the above addresses.  Even an "I am using PLT:" message
  350. | is welcome.  We have put a lot of effort into PLT: and since we did not
  351. | write PLT: for a profit, but merely for the ego boost, we would like to
  352. | know approximately how many people are using it, and what they think about
  353. | it.  Thank you.
  354. |
  355. | Rich Champeaux
  356.